package 力扣日常刷题.木22二月.第15天221;

import java.text.NumberFormat;

/**
 * @author 帅小伙
 * @date 2022/2/21
 * @description
 */
public class Demo119表示数值的字符串 {


    public boolean isNumber(String s) {
        if(s == null || s.length() == 0) return false;
        s = s.trim();
        try {
            double a = Double.parseDouble(s);
        }catch (Exception e){
            return false;
        }
        char c = s.charAt(s.length() - 1);
        return (c >= '0' && c <= '9') || c == '.';
    }

}
